I want to make a game with haxe. I am following my friend Travis’ tutorials but there are a few peccadillos I feel are worth noting. Here’s my experience getting going:
- Do not use Homebrew to install haxe on OS X. Use the downloadable installer. Here’s why. Download from here - not anywhere else.
-
I could not find in the docs / tutorials / getting started’s any examples of actually running haxe or haxelib or whatever except for here. No one thinks explaining the command line interface is important - I guess everyone’s using IDE’s? Anyway, here’s my command:
nme test /Users/you/path/to/project/project.nmml mac -debug -Dfdb
-
Immediately got
Standard Library not found
:/ Fix by adding this to your shell script:export HAXE_LIBRARY_PATH="/usr/lib/haxe/std/:/usr/lib/haxe/lib/"
-
libraries to install:
haxelib install nme haxelib install flixel
-
Next up:
Error: No developer directory found at /Developer.
Building for mac os x native. XCode doesn’t set up this directory any more when you install via the App Store. Solution here
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
-
Crash!
Couldn't set OpenGL mode: Sep 16 18:07:53 yourcomputer.home project[10076] Warning: CGDisplayBaseAddress is obsolete and returning NULL for display 0x7bd8d23f`
Solution - in /project.nmml change this:
<window width="0" height="0" fps="30" orientation="landscape" fullscreen="true" unless="target_flash" />
to this:
<window width="640" height="480" fps="30" orientation="landscape" resizable="true" unless="target_flash" />
It’s a bug in SDL, as per this discussion
-
Go to
/Applications/TextMate.app/Contents/SharedSupport/Bundles
and run
git clone https://github.com/jdonaldson/HaXe.tmbundle.git
to install the Haxe TextMate bundle. Don’t forget to tell TextMate to reload bundles.
After all that I finally got a compiling window.